<template>
  <page-layout>
    <a-row :gutter="[10, 10]">
      <!-- 顶部区域 -->
      <a-col :span="24">
        <a-card>
          <div class="box-ver-hor-between">
            <div class="primary-color">课程信息</div>
            <div>
              <a-button type="primary" class="mr-20">修改</a-button>
              <a-button type="primary" class="mr-20">邀请修改</a-button>
              <a-button type="primary">申请付款</a-button>
            </div>
          </div>
          <div class="box-ver-hor-between">
            <div>
              <a-button type="link" @click="gotoPage('detail')">详情</a-button>
              <a-button type="primary">课程信息</a-button>
              <a-button type="link" @click="gotoPage('paymentApplication')">付款申请</a-button>
              <a-button type="link" @click="gotoPage('curriculumEvaluation')">课程评价</a-button>
            </div>
          </div>
        </a-card>
      </a-col>
      <a-col :span="24">
        <a-card>
          <!-- 列表 -->
          <pro-table
            ref="tableRef"
            :fetch="fetch"
            :columns="columns"
            :pagination="pagination"
          >
          </pro-table>
        </a-card>
      </a-col>

    </a-row>
  </page-layout>
</template>
<script>
import {useRouter} from "vue-router"
import { tree, remove, removeBatch } from "@/api/module/dept";
export default{
  setup(){
    const router = useRouter();
    const gotoPage = (msg) => {
      router.push('/university/professor-manage/'+msg)
    }
    const columns = [
      { dataIndex: "pName", key: "pName", title: "课程名称" },
      { dataIndex: "school", key: "school", title:"项目名称" },
      { dataIndex: "phone", key: "phone", title: "开课时间"},
    ];
    const pagination = {
      Number: 1,
      total: 10,
    }
    /// 数据来源 [模拟]
    const fetch = async (param) => {
      var response = await tree(param);
      return {
        total: response.data.total,
        data: [{
          pName : '经济学',
          school : '成都校区21312312',
          phone : '2019-08-09至2021-03-02',
        }]
      };
    };
    return{
      gotoPage,
      columns,
      pagination,
      fetch,
    }
  }
}
</script>
